{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MNIST 手寫數字辨識資料集介紹 & 多層感知器模型(MLP)\n",
    "\n",
    "![MLP](http://cntk.ai/jup/cntk103c_MNIST_MLP.png)\n",
    "\n",
    "圖片出處:[CNTK_103C_MNIST_MultiLayerPerceptron](https://cntk.ai/pythondocs/CNTK_103C_MNIST_MultiLayerPerceptron.html)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP1. 匯入 Keras 及相關模組 \n",
    "\n",
    "首先匯入 Keras 及相關模組: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from keras.utils import np_utils  # 用來後續將 label 標籤轉為 one-hot-encoding\n",
    "\n",
    "np.random.seed(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP2. 下載 mnist 資料\n",
    "\n",
    "下載 Mnist 資料 \n",
    "我們將建立以下 Keras 程式, 下載並讀取 mnist 資料. \n",
    "\n",
    "Mnist 資料的下載路徑在 ~/.keras/datasets/mnist.npz (npz is a simple zip archive, which contains numpy files.) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from keras.datasets import mnist"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP3. 讀取與查看 mnist 資料"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t[Info] train data= 60,000\n",
      "\t[Info] test  data= 10,000\n"
     ]
    }
   ],
   "source": [
    "(X_train_image, y_train_label), (X_test_image, y_test_label) = mnist.load_data()\n",
    "\n",
    "print(\"\\t[Info] train data={:7,}\".format(len(X_train_image)))  \n",
    "print(\"\\t[Info] test  data={:7,}\".format(len(X_test_image))) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由上可以知道 training data 共有 60,000 筆; testing data 共有 10,000 筆。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 查看訓練資料\n",
    "\n",
    "接著我們來看載入資料的長相與格式."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP1. 訓練資料是由 images 與 labels 所組成"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t[Info] Shape of train data=(60000, 28, 28)\n",
      "\t[Info] Shape of train label=(60000,)\n"
     ]
    }
   ],
   "source": [
    "print(\"\\t[Info] Shape of train data=%s\" % (str(X_train_image.shape)))\n",
    "print(\"\\t[Info] Shape of train label=%s\" % (str(y_train_label.shape)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "訓練資料是由 images 與 labels 所組成共有 60,000 筆, 每一筆代表某個數字的影像為 28x28 pixels."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP2. 定應 plot_image 函數顯示數字影像"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "def plot_image(image):\n",
    "    fig = plt.gcf()\n",
    "    fig.set_size_inches(2, 2)\n",
    "    plt.imshow(image, cmap='binary') # cmap='binary' 參數設定以黑白灰階顯示\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP3. 執行 plot_image 函數查看第 0 筆數字影像與 label 資料 \n",
    "\n",
    "以下程式呼叫 plot_image 函數, 傳入 X_train_image[0], 也就是順練資料集的第 0 筆資料, 顯示結果可以看到這是一個數字 5 的圖形: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAJIAAACPCAYAAAARM4LLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACGVJREFUeJzt3V1oVOkZB/D/YzR+1a80ssRsMIuKEAp+EGuLRaPWjy5o\n8KZERass1As/WjBYUy/0woui0AuNN4uVVKwpxRp2LQuii7kQF0mCwSa7ZtVi3Cx+LaIWvdCVpxdz\ndjrPwSQnM0/OzGT+Pwg5/3OSOS/4+M4750yeEVUFUaZGZXsANDKwkMgFC4lcsJDIBQuJXLCQyAUL\niVywkMhFRoUkImtFpEdE7ojIfq9BUf6RdK9si0gRgK8BrALQB6ANwEZV/bK/3yktLdXKysq0zkfZ\n0dHR8Z2qTh/s50ZncI6fArijqv8BABH5O4BaAP0WUmVlJdrb2zM4JcVNRHqj/FwmT23lAL5JyX3B\nvvBAfisi7SLS/uTJkwxOR7ls2BfbqvqxqlaravX06YPOkJSnMimkbwFUpOT3g31UgDIppDYAc0Tk\nAxEpBlAH4FOfYVG+SXuxrarfi8guABcBFAE4pardbiOjvJLJqzao6mcAPnMaC+UxXtkmFywkcsFC\nIhcsJHLBQiIXLCRywUIiFywkcsFCIhcsJHLBQiIXGd1rKyRv3741+fnz55F/t7Gx0eRXr16Z3NPT\nY/KJEydMrq+vN7m5udnkcePGmbx////fPn/w4MHI48wEZyRywUIiFywkclEwa6T79++b/Pr1a5Ov\nXbtm8tWrV01+9uyZyefOnXMbW0VFhcm7d+82uaWlxeRJkyaZPG/ePJOXLVvmNraoOCORCxYSuWAh\nkYsRu0a6ceOGyStWrDB5KNeBvBUVFZl8+PBhkydOnGjy5s2bTZ4xY4bJ06ZNM3nu3LmZDnHIOCOR\nCxYSuWAhkYsRu0aaOXOmyaWlpSZ7rpEWL15scnjNcuXKFZOLi4tN3rJli9tYsoUzErlgIZELFhK5\nGL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q6nQ/UIpntkQtDpEISkTFIFNHfVPWH17qRWiSzPXJhGHSNJImeK38B8JWq/jnlUF61\nSH706JHJ3d3dJu/atcvkW7dupX2u8EeT7tu3z+Ta2lqT8+E60WCiXJBcAmALgH+LSGew749IFNA/\ngnbJvQB+PTxDpHwQ5VXbVQD9dYJii2QCwCvb5GTE3Gt7+vSpyeGPyers7DQ53MpvqJYsWZLcDv+t\n/5o1a0weP358RufKB5yRyAULiVywkMhFXq2Rrl+/ntw+cuSIORZ+X3RfX19G55owYYLJ4Y9vT70/\nFv549kLEGYlcsJDIRV49tbW0tLxzO4rwn/isW7fO5KKiIpPr6+tNDnf3J4szErlgIZELFhK5YFsb\nGhDb2lCsWEjkgoVELlhI5IKFRC5YSOSChUQuWEjkgoVELlhI5IKFRC5ivdcmIk+Q+KvcUgDfxXbi\noeHYrJmqOmjThlgLKXlSkfYoNwKzgWNLD5/ayAULiVxkq5A+ztJ5o+DY0pCVNRKNPHxqIxexFpKI\nrBWRHhG5IyJZbacsIqdE5LGIdKXsy4ne4fnY2zy2QhKRIgAnAPwKQBWAjUG/7mxpArA2tC9Xeofn\nX29zVY3lC8DPAVxMyQ0AGuI6fz9jqgTQlZJ7AJQF22UAerI5vpRxfQJgVa6OT1VjfWorB/BNSu4L\n9uWSnOsdni+9zbnY7ocm/ttn9SVtur3NsyHOQvoWQEVKfj/Yl0si9Q6PQya9zbMhzkJqAzBHRD4Q\nkWIAdUj06s4lP/QOB7LYOzxCb3Mg13qbx7xo/BDA1wDuAjiQ5QVsMxIf1vMGifXaRwB+jMSrodsA\nLgMoydLYfoHE09ZNAJ3B14e5Mr53ffHKNrngYptcsJDIBQuJXLCQyAULiVywkMgFC4lcsJDIxf8A\njM9gOIVbmEoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xda9b748>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_image(X_train_image[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_train_label[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 查看多筆訓練資料 images 與 labels\n",
    "\n",
    "接下來我們將建立 plot_images_labels_predict 函數, 可以顯示多筆資料的影像與 label. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP1. 建立 plot_images_labels_predict() 函數\n",
    "\n",
    "因為後續我們希望能很方便查看數字圖形, 真實的數字與預測結果, 所以我們建立了以下函數:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def plot_images_labels_predict(images, labels, prediction, idx, num=10):  \n",
    "    fig = plt.gcf()  \n",
    "    fig.set_size_inches(12, 14)  \n",
    "    if num > 25: num = 25  \n",
    "    for i in range(0, num):  \n",
    "        ax=plt.subplot(5,5, 1+i)  \n",
    "        ax.imshow(images[idx], cmap='binary')  \n",
    "        title = \"l=\" + str(labels[idx])  \n",
    "        if len(prediction) > 0:  \n",
    "            title = \"l={},p={}\".format(str(labels[idx]), str(prediction[idx]))  \n",
    "        else:  \n",
    "            title = \"l={}\".format(str(labels[idx]))  \n",
    "        ax.set_title(title, fontsize=10)  \n",
    "        ax.set_xticks([]); ax.set_yticks([])  \n",
    "        idx+=1  \n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP2. 查看訓練資料的前 10 筆資料"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAArMAAAEwCAYAAACkK/nwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XuYTvX+//H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XWbMeZjEVkrIvM9z3s76IJSzXieF3QNAAAAQKlwZxYAAADOopkFAACA\ns2hmAQAA4CyaWQAAADgrrqW56tSp42VlZSWpFKRSQUGBFBUVJeX1Q5wn5UteXl6R53l1k7FvzpXy\ng2sKYsU1BbGI55oSVzOblZUlH374YemqQqi0bds2afvmPClfjDGFydo350r5wTUFseKagljEc01h\nzAAAAADOopkFAACAs2hmAQAA4CyaWQAAADiLZhYAAADOopkFAACAs2hmAQAA4CyaWQAAADiLZhYA\nAADOopkFAACAs2hmAQAA4CyaWQAAADiLZhYAAADOopkFAACAs2hmAQAA4KyKQRcAlBd5eXkqT5o0\nSeWcnBzfNtdcc43KN998s8onnXRSgqoDAKB84s4sAAAAnEUzCwAAAGfRzAIAAMBZaTkze+DAAZV3\n7twZ1/b2LORPP/3k+84nn3yi8uOPP67yrbfeqvLMmTNVrlq1qsrDhw9X+e67746tWCTN6tWrVT7n\nnHNU3rVrl8rGGN8+XnjhBZXnzp2rcnFxcVlKRBp56623VL7iiitUXrJkicrHHnts0mtC6t17770q\n33XXXSp7nqfyO++8o3LHjh2TUheQTNyZBQAAgLNoZgEAAOAsmlkAAAA4y7mZ2c8//1zlffv2qbx8\n+XLfNu+++67KO3bsUHnOnDkJqu5/mjRporK9fugrr7yics2aNVU+4YQTVGaOKXgffPCByhdffLHK\n9uy1PSObmZnp22flypVVLioqUnnFihUqn3zyyRG3T0dLly5V+bvvvlO5Z8+eqSwnMCtXrlS5bdu2\nAVWCVHn++ed9n40dO1bljIwMle1nRkqa5Qdcw51ZAAAAOItmFgAAAM6imQUAAICzQj8z+9FHH6nc\nuXNnleNdIzYZ7JkkEf9afzVq1FDZXgOyUaNGKteuXVtl1oRMPnu94FWrVql85ZVXqrx169a49n/0\n0Uf7Phs2bJjKl112mcpnnHGGyvZ5NWLEiLhqKI/sdTI3b96scnmdmT148KDKn332mcr28wX2+qJw\nX2Fhoe+zvXv3BlAJEu39999Xedq0aSrbzwqsW7cu4v4eeugh32d237Fs2T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AwFmBz8zaazracyJ2BsKiZcuWEfOGDRtSWQ4OmTp1qsoTJ05UOScn\nJ+HHbN68ucrVq1dXuUOHDipfd911Krdu3TrhNcE9s2bNUtmek7avMXBTnz59fJ+NGjVKZXuOHpFx\nZxYAAADOopkFAACAs2hmAQAA4KzAZ2YBVzVt2lTl/Pz8gCrB75144okqP/nkkyq3a9dO5TvvvFPl\n4uJilbOzs33H6Natm8o9evRQuUGDBrEVC/xOx44dVf74449VrlatWirLQZKMGDEips8QO+7MAgAA\nwFk0swAAAHAWzSwAAACcRTMLAAAAZ/EAGIByrUqVKioPHDgwYgaCkpubG3QJgJO4MwsAAABn0cwC\nAADAWTSzAAAAcBbNLAAAAJxFMwsAAABn0cwCAADAWTSzAAAAcBbNLAAAAJxFMwsAAABn0cwCAADA\nWTSzAAAAcJbxPC/2LxuzXUQKk1cOUqip53l1k7FjzpNyh3MFseA8Qaw4VxCLmM+TuJpZAAAAIEwY\nMwAAAICzaGYBAADgLJpZAAAAOItmFgAAAM6imQUAAICzaGYBAADgLJpZAAAAOItmFgAAAM6imQUA\nAICz/j+eXIut1A8c+AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x12775940>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_images_labels_predict(X_train_image, y_train_label, [], 0, 10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 多層感知器模型資料前處理\n",
    "\n",
    "接下來我們建立 多層感知器模型 (MLP), 我們必須先將 images 與 labels 的內容進行前處理, 才能餵進去 Keras 預期的資料結構。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP1. features (數字影像的特徵值) 資料前處理\n",
    "\n",
    "首先將 image 以 reshape 轉換為二維 ndarray 並進行 normalization (Feature scaling): "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t[Info] xTrain: (60000, 784)\n",
      "\t[Info] xTest: (10000, 784)\n"
     ]
    }
   ],
   "source": [
    "x_Train = X_train_image.reshape(60000, 28*28).astype('float32')\n",
    "x_Test = X_test_image.reshape(10000, 28*28).astype('float32')\n",
    "print(\"\\t[Info] xTrain: %s\" % (str(x_Train.shape)))\n",
    "print(\"\\t[Info] xTest: %s\" % (str(x_Test.shape)))\n",
    "  \n",
    "# Normalization\n",
    "x_Train_norm = x_Train/255\n",
    "x_Test_norm = x_Test/255"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP2. labels (影像數字真實的值) 資料前處理\n",
    "\n",
    "label 標籤欄位原本是 0-9 數字, 而為了配合 Keras 的資料格式, 我們必須進行 One-hot-encoding 將之轉換為 10 個 0 或 1 的組合, 例如數字 7 經過 One-hot encoding 轉換後是 0000001000, 正好對應到輸出層的 10 個神經元. 下面簡單測試過程:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_TrainOneHot = np_utils.to_categorical(y_train_label) # 將 training 的 label 進行 one-hot encoding\n",
    "y_TestOneHot = np_utils.to_categorical(y_test_label) # 將測試的 labels 進行 one-hot encoding\n",
    "\n",
    "y_train_label[0] # 檢視 training labels 第一個 label 的值\n",
    "y_TrainOneHot[:1] # 檢視第一個 label 在 one-hot encoding 後的結果, 會在第六個位置上為 1, 其他位置上為 0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建立模型\n",
    "\n",
    "我們將建立以下多層感知器 Multilayer Perceptron 模型, 輸入層 (x) 共有 28x28=784 個神經元, Hidden layers (h) 共有 256 層; 輸出層 (y) 共有 10 個 神經元:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![mlp](https://3.bp.blogspot.com/-TpTfcbPRWWY/WVW-EUCKVLI/AAAAAAAAWuE/sn9sX6qMc38UePENvSmmgLH3bA7za-3ogCLcBGAs/s1600/3946_3.PNG)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "對應代碼:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t[Info] Model summary:\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_1 (Dense)              (None, 256)               200960    \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 10)                2570      \n",
      "=================================================================\n",
      "Total params: 203,530\n",
      "Trainable params: 203,530\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from keras.models import Sequential  \n",
    "from keras.layers import Dense  \n",
    "  \n",
    "model = Sequential()  # Build Linear Model  \n",
    "  \n",
    "model.add(Dense(units=256, input_dim=784, kernel_initializer='normal', activation='relu')) # Add Input/hidden layer  \n",
    "model.add(Dense(units=10, kernel_initializer='normal', activation='softmax')) # Add Hidden/output layer  \n",
    "print(\"\\t[Info] Model summary:\")  \n",
    "model.summary()  \n",
    "print(\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Summary 的相關說明:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![mlp](https://1.bp.blogspot.com/-XYUDaErijCI/WVW-IliFkOI/AAAAAAAAWuI/g4zOWWWMfpIwIEYWLq2zd0qVJHlRanTHACLcBGAs/s1600/3946_4.PNG)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 進行訓練\n",
    "\n",
    "當我們建立深度學習模型後, 就可以使用 Backpropagation 進行訓練。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP1. 定義訓練方式\n",
    "\n",
    "在訓練模型之前, 我們必須先使用 compile 方法, 對訓練模型進行設定, 代碼如下:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "參數說明如下:\n",
    "* **loss** : 設定 loss function, 在深度學習通常使用 cross_entropy (Cross entropy) 交叉摘順練效果較好.\n",
    "* **optimizer** : 設定訓練時的優化方法, 在深度學習使用 adam 可以讓訓練更快收斂, 並提高準確率.\n",
    "* **metrics** : 設定評估模型的方式是 accuracy (準確率)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP2. 開始訓練\n",
    "執行訓練的程式碼如下:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 48000 samples, validate on 12000 samples\n",
      "Epoch 1/10\n",
      "3s - loss: 0.4385 - acc: 0.8829 - val_loss: 0.2181 - val_acc: 0.9408\n",
      "Epoch 2/10\n",
      "3s - loss: 0.1907 - acc: 0.9455 - val_loss: 0.1554 - val_acc: 0.9559\n",
      "Epoch 3/10\n",
      "3s - loss: 0.1354 - acc: 0.9618 - val_loss: 0.1259 - val_acc: 0.9648\n",
      "Epoch 4/10\n",
      "3s - loss: 0.1027 - acc: 0.9704 - val_loss: 0.1121 - val_acc: 0.9678\n",
      "Epoch 5/10\n",
      "3s - loss: 0.0810 - acc: 0.9774 - val_loss: 0.0982 - val_acc: 0.9716\n",
      "Epoch 6/10\n",
      "3s - loss: 0.0659 - acc: 0.9818 - val_loss: 0.0931 - val_acc: 0.9723\n",
      "Epoch 7/10\n",
      "3s - loss: 0.0544 - acc: 0.9851 - val_loss: 0.0912 - val_acc: 0.9739\n",
      "Epoch 8/10\n",
      "3s - loss: 0.0459 - acc: 0.9876 - val_loss: 0.0822 - val_acc: 0.9760\n",
      "Epoch 9/10\n",
      "3s - loss: 0.0381 - acc: 0.9902 - val_loss: 0.0820 - val_acc: 0.9761\n",
      "Epoch 10/10\n",
      "3s - loss: 0.0317 - acc: 0.9918 - val_loss: 0.0809 - val_acc: 0.9760\n"
     ]
    }
   ],
   "source": [
    "train_history = model.fit(x=x_Train_norm, \n",
    "                          y=y_TrainOneHot, \n",
    "                          validation_split=0.2, \n",
    "                          epochs=10, \n",
    "                          batch_size=200, \n",
    "                          verbose=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "上面訓練過程會儲存於 train_history 變數中, 參數說明如下: \n",
    "\n",
    "* **x = x_Train_norm** : features 數字的影像特徵值 (60,000 x 784 的陣列)\n",
    "* **y = y_Train_OneHot** : label 數字的 One-hot encoding 陣列 (60,000 x 10 的陣列)\n",
    "* **validation_split = 0.2** : 設定訓練資料與 cross validation 的資料比率. 也就是說會有 0.8 * 60,000 = 48,000 作為訓練資料; 0.2 * 60,000 = 12,000 作為驗證資料.\n",
    "* **epochs** = 10 : 執行 10 次的訓練週期.\n",
    "* **batch_size = 200** : 每一批次的訓練筆數為 200\n",
    "* **verbose = 2** : 顯示訓練過程. 共執行 10 次 epoch (訓練週期), 每批 200 筆, 也就是每次會有 240 round (48,000 / 200 = 240). 每一次的 epoch 會計算 accuracy 並記錄在 train_history 中."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP3. 建立 show_train_history 顯示訓練過程\n",
    "\n",
    "之前訓練步驟會將每一個訓練週期的 accuracy 與 loss 記錄在 train_history 變數. 我們可以使用下面程式碼讀取 train_history 以圖表顯示訓練過程:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt  \n",
    "def show_train_history(train_history, train, validation):  \n",
    "    plt.plot(train_history.history[train])  \n",
    "    plt.plot(train_history.history[validation])  \n",
    "    plt.title('Train History')  \n",
    "    plt.ylabel(train)  \n",
    "    plt.xlabel('Epoch')  \n",
    "    plt.legend(['train', 'validation'], loc='upper left')  \n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "執行結果如下:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEWCAYAAAB1xKBvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8lOW99/HPjyyELIRshCWEoCxhkU3AXRFsq61LXerS\naqtVOVat1qfPOcf2LLVPe87xeV4eT+vpYrXVWqu1FuvpZrUVULRugCCyBEQIEJasLFnJMr/nj5nA\nEAIkMJNJMt/365VXZuZe5jcj3t9c93Xf12XujoiIyPEMiHUBIiLSNygwRESkSxQYIiLSJQoMERHp\nEgWGiIh0iQJDRES6RIEhchRmlmBmdWZWGKX9n2JmddHYt0g0KDCk3wgd3Nt/AmbWGPb8C93dn7u3\nuXu6u287gVrGmtkRNzmZ2S/N7IHQ/je7e3oX9nWbmb3W3RpEIi0x1gWIREr4wdfMSoHb3P3Vo61v\nZonu3toTtcVSvHxOiT61MCRumNl3zezXZvYrM6sFbjSzs8zsHTPba2a7zOwRM0sKrZ9oZm5mRaHn\nvwwt/7OZ1ZrZ22Y25iTqOawVYma3mllpaN+bzex6MzsN+AFwXqilVBVad0ionsrQNt8wMwstu83M\nloZqrQG+G/p8E8Pea7iZNZhZzonWL/FHgSHx5krgWSAT+DXQCtwL5ALnABcDf3eM7T8P/AuQDWwD\nvhOJosxsMPAw8Al3zwjVstrdPwTuBt4InR7LDW3yIyAVOAWYB9wKfDFsl2cD64E84NvA88CNHT7H\nK+5eHYn6JT4oMCTevOnuf3D3gLs3u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senFoZI5PhRHnfHgbDHbaifUXoRBYZI5FwX9vvt0OO3ODR15xeA\nN0KPFwFfgYPzhmf2VJEiJ0p/vYh0z6CwkXwhOMd1+6W1WWa2mmAr4YbQa18lOEvd3xOcsa59hNd7\ngcfM7FaCLYmvEJy5TaTXUh+GSASE+jBmuXtVrGsRiRadkhIRkS5RC0NERLpELQwREekSBYaIiHSJ\nAkNERLpEgSEiIl2iwBARkS75/0lnA1pcQcR4AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x128ef438>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_train_history(train_history, 'acc', 'val_acc')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如果 \"acc 訓練的準確率\" 一直提升, 但是 \"val_acc 的準確率\" 卻一直沒有增加, 就有可能是 Overfitting 的現象 (更多說明請參考 Bias, Variance, and Overfitting). 在完成所有 (epoch) 訓練週期後, 在後面還會使用測試資料來評估模型準確率, 這是另外一組獨立的資料, 所以計算準確率會更客觀. 接著我們來看 loss 誤差的執行結果: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEWCAYAAAB1xKBvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8XPWZ7/HPo1EvVh3JtiRbLpIrbgjTjIVD4rVJCBAS\nMAkQEogXAil3s7thsze72U2yN7nJZUlCcRxCCoEACzGQYDCQgI2ptsEYF1xxkdwkWb1a0nP/OCNp\nJEvySJqjkTTP+/XSa2ZOm2cGo69+53d+vyOqijHGGHM2EaEuwBhjzMhggWGMMSYgFhjGGGMCYoFh\njDEmIBYYxhhjAmKBYYwxJiAWGMb0QkQ8IlIrIhNcOv5kEal149jGuMECw4wavl/u7T9tItLg9/oL\n/T2eqraqaqKqHh5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S\n1RYRuRNYh3OVw0OquiPEZYXSxcCNwAcistW37DuqujaENZnh42vAI74/rg4AXwpxPSGjqm+LyJPA\nuzhXF75HGEwTYlODGGOMCUi4n5IyxhgTIAsMY4wxAbHAMMYYExALDGOMMQGxwDDGGBMQCwxj+kFE\nWkVkq99P0EY7i0ieiGwP1vGMCbawHodhzAA0qOq8UBdhTChYC8OYIBCRgyLyf0XkAxF5R0Sm+pbn\nicjfRGSbiPxVRCb4lmeJyBoRed/30z6thEdEfuW7z8KLIhIXsg9lTDcWGMb0T1y3U1LX+a2rUtVz\ngHtxZroF+AXwO1WdAzwC/Ny3/OfAelWdizMnU/sMA/nAfao6C6gErnH58xgTMBvpbUw/iEitqib2\nsPwg8DFVPeCbwPG4qqaLSBkwTlVP+5YfU9UMESkFclS1ye8YecBLqprve/1tIEpVf+D+JzPm7KyF\nYUzwaC/P+6PJ73kr1s9ohhELDGOC5zq/xzd9z9+g89adXwBe8z3/K3A7dNw3PHmoijRmoOyvF2P6\nJ85vJl9w7nHdfmltqohsw2klXO9b9jWcu9T9E84d69pneP0GsFpEbsFpSdyOc+c2Y4Yt68MwJgh8\nfRiFqloW6lqMcYudkjLGGBMQa2EYY4wJiLUwjDHGBMQCwxhjTEAsMIwxxgTEAsMYY0xALDCMMcYE\n5P8DbodGauHmTm4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x128ff320>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_train_history(train_history, 'loss', 'val_loss')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "總共執行 10 個 Epoch 訓練週期, 可以發現:    \n",
    "* 不論訓練與驗證, 誤差越來越低.\n",
    "* 在 Epoch 訓練後期, \"loss 訓練的誤差\" 比 \"val_loss 驗證的誤差\" 小."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 以測試資料評估模型準確率與預測 \n",
    "\n",
    "我們已經完成訓練模型, 現在要使用 test 測試資料來評估模型準確率。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP1. 評估模型準確率\n",
    "\n",
    "使用下面代碼評估模型準確率:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 9760/10000 [============================>.] - ETA: 0s\n",
      "\t[Info] Accuracy of testing data = 97.5%\n"
     ]
    }
   ],
   "source": [
    "scores = model.evaluate(x_Test_norm, y_TestOneHot)  \n",
    "print()  \n",
    "print(\"\\t[Info] Accuracy of testing data = {:2.1f}%\".format(scores[1]*100.0))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STEP2. 進行預測\n",
    "前面我們建立模型並於訓練後達成可以接受的 97% 準確率, 接著我們將使用此模型進行預測。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t[Info] Making prediction to x_Test_norm\n",
      " 9792/10000 [============================>.] - ETA: 0s\n",
      "\t[Info] Show 10 prediction result (From 240):\n",
      "[5 9 8 7 2 3 0 2 4 2]\n",
      "\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAArMAAAEwCAYAAACkK/nwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XvcjVX+//HPqhAiJiaEiCQRTUKNEippNEVOU4hUUjpp\nSL9+6ZfOOsvQmZooIRQKpaiZyqFMDiEVcoy+GELjsL5/3Lvf+Ky97733de9rH9b2ej4eHnnv+7rW\nXreWa3/uy2evbay1AgAAAPjoiGxPAAAAACgqilkAAAB4i2IWAAAA3qKYBQAAgLcoZgEAAOAtilkA\nAAB4Ky+KWWPMrgDHjjbG/GCMWRT51Sjkufw/Y8z6Q8a/JMzxUXQB10krY8yXxpglxph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GXSitbZiOgZmneQd1gqSwTpBslgrSEbS6yRQMQsAAADkEtoMAAAA4C2K\nWQAAAHiLYhYAAADeopgFAACAtyhmAQAA4C2KWQAAAHiLYhYAAADeopgFAACAtyhmAQAA4K3/Bd4i\nflt57+VoAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x12d03f60>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(\"\\t[Info] Making prediction to x_Test_norm\")  \n",
    "prediction = model.predict_classes(x_Test_norm)  # Making prediction and save result to prediction  \n",
    "print()  \n",
    "print(\"\\t[Info] Show 10 prediction result (From 240):\")  \n",
    "print(\"%s\\n\" % (prediction[240:250]))  \n",
    "  \n",
    "plot_images_labels_predict(X_test_image, y_test_label, prediction, idx=240)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "上面可以發現有個預測結果為 6, 但實際 label 為 4. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 總結 (Conclusion)\n",
    "\n",
    "在這篇文章中有一些個人學習到的一些有趣的重點:\n",
    "\n",
    "* Mnist的手寫資料集雖然很簡單, 但對很多不熟悉把圖像處理的人來說, Mnist絕對是一個合適用來做練習與講解的好資料集\n",
    "* 需要了解網絡的結構與不同網絡層輸入輸出的張量的結構才能夠清楚地構建一個對的模型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "參考:\n",
    "* [程式扎記 - MNIST 手寫數字辨識資料集介紹](http://puremonkey2010.blogspot.tw/2017/07/toolkit-keras-mnist-cnn.html)\n",
    "* [林大貴 - TensorFlow+Keras深度學習人工智慧實務應用](http://tensorflowkeras.blogspot.com)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
